package cn.zwz.insurance.controller;

import cn.zwz.basics.baseVo.PageVo;
import cn.zwz.basics.baseVo.Result;
import cn.zwz.basics.utils.PageUtil;
import cn.zwz.basics.utils.ResultUtil;
import cn.zwz.insurance.entity.Examine;
import cn.zwz.insurance.entity.Flow;
import cn.zwz.insurance.service.IFlowService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jsx on 2023/4/10
 **/
@RequestMapping("/zwz/flow")
@RestController
public class FlowController {
    @Autowired
    private IFlowService flowService;

    @GetMapping("/getFlowByUserId")
    public Result<IPage<Examine>> getFlowByUserId(String id ,@ModelAttribute PageVo page){
        QueryWrapper<Flow> wrapper = new QueryWrapper<>();
        wrapper.eq("roster_id",id);
        IPage<Examine> data = flowService.page(PageUtil.initMpPage(page),wrapper);
        return new ResultUtil<IPage<Examine>>().setData(data);
    }
}
